<% if @kc.display_state != "running" %>
  <div class="auto-refresh hidden" data-interval="10"></div>
<% end %>

<% data = [
  ["ID", @kc.ubid],
  ["Name", @kc.name],
  ["Location", @kc.display_location],
  ["Kubernetes Version", @kc.version],
  ["Control Plane Nodes", @kc.cp_node_count],
  ["Worker Nodes", @kc.nodepools.sum { it.node_count }]
]

if @kc.display_state == "running"
  data.push(["Service URL", @kc.services_lb.hostname, { copyable: true }]) # TODO: Assign LB to a column properly
  data.push(["Kubeconfig", part("components/download_button", link: "#{path(@kc)}/kubeconfig"), { escape: false }])
else
  data.push(["Kubeconfig", "Waiting for cluster to be ready..."])
end %>

<%== part("components/kv_data_card", data: data) %>
